home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / live / usr / bin / freetype2-config < prev    next >
Encoding:
Text File  |  2002-07-02  |  1.5 KB  |  105 lines

  1. #! /bin/sh
  2.  
  3. prefix=/usr
  4. exec_prefix=${prefix}
  5.  
  6. usage()
  7. {
  8.   cat <<EOF
  9. Usage: freetype-config [OPTIONS] [LIBRARIES]
  10. Options:
  11.  [--prefix[=DIR]]
  12.  [--exec-prefix[=DIR]]
  13.  [--version]
  14.  [--libs]
  15.  [--libtool]
  16.  [--cflags]
  17. EOF
  18.   exit $1
  19. }
  20.  
  21. if test $# -eq 0 ; then
  22.   usage 1 1>&2
  23. fi
  24.  
  25. while test $# -gt 0 ; do
  26.   case "$1" in
  27.   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  28.   *) optarg= ;;
  29.   esac
  30.  
  31.   case $1 in
  32.   --prefix=*)
  33.     prefix=$optarg
  34.     local_prefix=yes
  35.     ;;
  36.   --prefix)
  37.     echo_prefix=yes
  38.     ;;
  39.   --exec-prefix=*)
  40.     exec_prefix=$optarg
  41.     exec_prefix_set=yes
  42.     local_prefix=yes
  43.     ;;
  44.   --exec-prefix)
  45.     echo_exec_prefix=yes
  46.     ;;
  47.   --version)
  48.     echo 9.0.3
  49.     exit 0
  50.     ;;
  51.   --cflags)
  52.     echo_cflags=yes
  53.     ;;
  54.   --libs)
  55.     echo_libs=yes
  56.     ;;
  57.   --libtool)
  58.     echo_libtool=yes
  59.     ;;
  60.   *)
  61.     usage 1 1>&2
  62.     ;;
  63.   esac
  64.   shift
  65. done
  66.  
  67. if test "$local_prefix" = "yes" ; then
  68.     if test "$exec_prefix_set" != "yes" ; then
  69.       exec_prefix=$prefix
  70.     fi
  71. fi
  72.  
  73. if test "$echo_prefix" = "yes" ; then
  74.  echo $prefix
  75. fi
  76.  
  77. if test "$echo_exec_prefix" = "yes" ; then
  78.  echo $exec_prefix
  79. fi
  80.  
  81. if test "$echo_cflags" = "yes" ; then
  82.  cflags="-I${prefix}/include/freetype2"
  83.  if test "${prefix}/include" != "/usr/include" ; then
  84.   echo -I${prefix}/include $cflags
  85.  else
  86.   echo $cflags
  87.  fi
  88. fi
  89.  
  90. if test "$echo_libs" = "yes" ; then
  91.  libs="-lfreetype"
  92.  if test "${exec_prefix}/lib" != "/usr/lib" ; then
  93.   echo -L${exec_prefix}/lib $libs
  94.  else
  95.   echo $libs
  96.  fi
  97. fi
  98.  
  99. if test "$echo_libtool" = "yes" ; then
  100.  convlib="libfreetype.la"
  101.  echo ${exec_prefix}/lib/$convlib
  102. fi
  103.  
  104. # EOF
  105.